#include "mainwindow.h"
#include <QApplication>
#include <QFile>
#include <QDebug>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    //w.show();
    QFile file("./test.txt");
    file.open(QFile::ReadWrite | QFile::Truncate);
    qDebug() << file.isSequential();
    file.write("今天是星期三", 6);
    file.write("is Wen。");
    file.write(QByteArray("是Qt的第5天。"));
    qDebug() << "pos: " << file.pos();
    qDebug() << "atEnd: " << file.atEnd();
    file.seek(6);
    qDebug() << "pos: " << file.pos();
    qDebug() << file.peek(6);
    qDebug() << "pos: " << file.pos();
    char cs[36];
    qDebug() << "read: " << file.read(cs, 6);
    qDebug() << "cs: " << cs;
    qDebug() << "pos: " << file.pos();
    qDebug() << "read: " << QString(file.read(8));
    qDebug() << "readAll: " << QString(file.readAll());
    file.link("test.txt.lnk");
    file.copy("testCopy.txt");
    file.close();
    file.remove();

    return a.exec();
}
